package xuegao.study.mall.web.service;

import xuegao.study.mall.common.dto.OmsOrderDetail;
import xuegao.study.mall.web.domain.ConfirmOrderResult;
import xuegao.study.mall.web.domain.OrderParam;
import xuegao.study.mall.common.api.CommonPage;

import java.util.List;
import java.util.Map;

public interface PortalOrderService {
    /**
     * 根据购物车id获取确认单
     */
    ConfirmOrderResult generateConfirmOrder(List<Long> cartIds);

    /**
     * 生成订单
     */
    Map<String, Object> generateOrder(OrderParam param);

    OmsOrderDetail detail(Long orderId);

    Integer paySuccess(Long orderId, Integer payType);

    void paySuccessByOrderSn(String orderSn, Integer payType);

    CommonPage<OmsOrderDetail> list(Integer status, Integer pageNum, Integer pageSize);

    /**
     * 自动取消超时订单
     * @return
     */
    Integer cancelTimeOutOrder();

    /**
     * 取消单个超时订单
     * @param orderId orderId
     */
    void cancelOrder(Long orderId);

    /**
     * 发起延时队列取消订单
     * @param orderId orderId
     */
    void sendDelayMessageCancelOrder(Long orderId);

    /**
     * 确认收货
     * @param orderId orderId
     */
    void confirmReceiveOrder(Long orderId);

    /**
     * 根据订单id删除订单
     * @param orderId
     */
    void deleteOrder(Long orderId);
}
